﻿using System;
using System.Collections.Generic;
using System.Text;
using YouHP.BLL;
using YouHP.Utility;
using YouHP.Model;
using System.Text.RegularExpressions;
using System.Web;

namespace YouHP.Pages.User
{
    public class NewLogComment : UserBasePage
    {
        protected override void ShowPage()
        {
            base.ShowPage();
            if (this.ErrorCount > 0) return;

            HandleCommon();
            if (IsPost) HandlePost();
            else HandleGet();
        }

        protected LogCommentInfo LogCommentData;
        protected LogTopicInfo LogData;

        protected void HandleCommon()
        {
            this.SetTitle("日志评论");
            this.AddLocation("日志评论", "");
            this.AddScriptSrc("/support/Alpha/Js/mootools.js");

        }
        protected void HandlePost()
        {
            int lid = RequestTools.GetFormInt("logId", -1);
            int logCommentId = RequestTools.GetFormInt("logCommentId", -1);

            bool succ = LogCommentBLL.Instance.DeleteLogComment(lid, logCommentId);
            if (succ)
            {
                this.Redirect("/User/NewLogCommentReplyList.aspx");
            }
            else
            {
                this.AddErrLine("系统操作失败！");
                return;
            }
        }

        protected void HandleGet()
        {
            int LogCommentId = RequestTools.GetQueryInt("logcommentId",0);
            LogCommentData = LogCommentBLL.Instance.GetLogCommentInfo(LogCommentId);
            LogData = LogTopicBLL.Instance.GetLogTopicInfo(LogCommentData.LogTopicId);

        }
    }
}